package com.example.makerspace.controller;


import com.example.makerspace.dto.Result;
import com.example.makerspace.service.DataService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("/api/data")
@ResponseBody
public class DataController {

    @Resource
    private DataService dataService;

    @GetMapping("/visit")
    public Result visit(){
        return dataService.visit();
    }

    @GetMapping("/applicationData")
    public Result applicationData(){
        return dataService.applicationData();
    }

    @GetMapping("/participants")
    public Result participants(){
        return dataService.participants();
    }

    @GetMapping("/latestNews")
    public Result latestNews(){
        return dataService.latestNews();
    }

    @GetMapping("/latestApplication")
    public Result latestApplication(){
        return dataService.latestApplication();
    }

}
